package pe.gob.sunat.georeferencia.model.dao.ibatis;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import pe.gob.sunat.georeferencia.model.dao.MaestroZonaDAO;
import pe.gob.sunat.georeferencia.model.domain.MaestroZona;
import pe.gob.sunat.georeferencia.model.domain.MaestroZonaCriteria;

@SuppressWarnings("deprecation")
public class MaestroZonaDAOImpl extends SqlMapClientDaoSupport implements MaestroZonaDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public MaestroZonaDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public int countByExample(MaestroZonaCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("t0005maes_zona.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public int deleteByExample(MaestroZonaCriteria example) {
        int rows = getSqlMapClientTemplate().delete("t0005maes_zona.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public int deleteByPrimaryKey(String codZona) {
        MaestroZona key = new MaestroZona();
        key.setCodZona(codZona);
        int rows = getSqlMapClientTemplate().delete("t0005maes_zona.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public void insert(MaestroZona record) {
        getSqlMapClientTemplate().insert("t0005maes_zona.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public void insertSelective(MaestroZona record) {
        getSqlMapClientTemplate().insert("t0005maes_zona.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    @SuppressWarnings("unchecked")
    public List<MaestroZona> selectByExample(MaestroZonaCriteria example) {
        List<MaestroZona> list = getSqlMapClientTemplate().queryForList("t0005maes_zona.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public MaestroZona selectByPrimaryKey(String codZona) {
        MaestroZona key = new MaestroZona();
        key.setCodZona(codZona);
        MaestroZona record = (MaestroZona) getSqlMapClientTemplate().queryForObject("t0005maes_zona.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public int updateByExampleSelective(MaestroZona record, MaestroZonaCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t0005maes_zona.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public int updateByExample(MaestroZona record, MaestroZonaCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t0005maes_zona.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public int updateByPrimaryKeySelective(MaestroZona record) {
        int rows = getSqlMapClientTemplate().update("t0005maes_zona.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    public int updateByPrimaryKey(MaestroZona record) {
        int rows = getSqlMapClientTemplate().update("t0005maes_zona.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table t0005maes_zona
     *
     * @ibatorgenerated
     */
    private static class UpdateByExampleParms extends MaestroZonaCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, MaestroZonaCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}